﻿namespace Server.Business.Player
{
    public class PlayerData
    {
        public PlayerData(long _uid)
        {
            Uid = _uid;
        }

        /// <summary>
        /// 玩家的唯一Uid
        /// </summary>
        public long Uid { get; private set; }

        /// <summary>
        /// 用户的TcpSocketId
        /// </summary>
        public string WebSocketId { get; private set; }

        /// <summary>
        /// 是否登录了账号
        /// </summary>
        public bool IsLogin { get; private set; } = false;

        /// <summary>
        /// 是否进入游戏
        /// </summary>
        public bool IsEnter { get; private set; } = false;

        /// <summary>
        /// 登陆了
        /// </summary>
        public void Login()
        {
            IsLogin = true;
        }

        /// <summary>
        /// 进入游戏了
        /// </summary>
        public void Enter()
        {
            IsEnter = true;
        }

        /// <summary>
        /// 设置WebSocketId
        /// </summary>
        public void SetWebSocketId(string _id)
        {
            WebSocketId = _id;
        }
    }   
}